package com.zr.model;
// Generated 2017-7-6 10:10:11 by Hibernate Tools 4.0.0.Final

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Ccarreport generated by hbm2java
 */
@Entity
@Table(name = "ccarreport", catalog = "cqlwlps")
public class Ccarreport implements java.io.Serializable {

	private Integer crid;
	private Ccarinfo ccarinfo;
	private Cdriver cdriverByDid1;
	private Cuser cuser;
	private Cdriver cdriverByDid2;
	private String cstime;
	private String setime;
	private String action;
	private String place;
	private Set<Creceipt> creceipts = new HashSet<Creceipt>(0);

	public Ccarreport() {
	}

	public Ccarreport(Ccarinfo ccarinfo, Cdriver cdriverByDid1, Cuser cuser, String cstime, String setime,
			String action, String place) {
		this.ccarinfo = ccarinfo;
		this.cdriverByDid1 = cdriverByDid1;
		this.cuser = cuser;
		this.cstime = cstime;
		this.setime = setime;
		this.action = action;
		this.place = place;
	}

	public Ccarreport(Ccarinfo ccarinfo, Cdriver cdriverByDid1, Cuser cuser, Cdriver cdriverByDid2, String cstime,
			String setime, String action, String place, Set<Creceipt> creceipts) {
		this.ccarinfo = ccarinfo;
		this.cdriverByDid1 = cdriverByDid1;
		this.cuser = cuser;
		this.cdriverByDid2 = cdriverByDid2;
		this.cstime = cstime;
		this.setime = setime;
		this.action = action;
		this.place = place;
		this.creceipts = creceipts;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "crid", unique = true, nullable = false)
	public Integer getCrid() {
		return this.crid;
	}

	public void setCrid(Integer crid) {
		this.crid = crid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "cid", nullable = false)
	public Ccarinfo getCcarinfo() {
		return this.ccarinfo;
	}

	public void setCcarinfo(Ccarinfo ccarinfo) {
		this.ccarinfo = ccarinfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "did1", nullable = false)
	public Cdriver getCdriverByDid1() {
		return this.cdriverByDid1;
	}

	public void setCdriverByDid1(Cdriver cdriverByDid1) {
		this.cdriverByDid1 = cdriverByDid1;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "uid", nullable = false)
	public Cuser getCuser() {
		return this.cuser;
	}

	public void setCuser(Cuser cuser) {
		this.cuser = cuser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "did2")
	public Cdriver getCdriverByDid2() {
		return this.cdriverByDid2;
	}

	public void setCdriverByDid2(Cdriver cdriverByDid2) {
		this.cdriverByDid2 = cdriverByDid2;
	}

	@Column(name = "cstime", nullable = false)
	public String getCstime() {
		return this.cstime;
	}

	public void setCstime(String cstime) {
		this.cstime = cstime;
	}

	@Column(name = "setime", nullable = false)
	public String getSetime() {
		return this.setime;
	}

	public void setSetime(String setime) {
		this.setime = setime;
	}

	@Column(name = "action", nullable = false)
	public String getAction() {
		return this.action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	@Column(name = "place", nullable = false)
	public String getPlace() {
		return this.place;
	}

	public void setPlace(String place) {
		this.place = place;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "ccarreport")
	public Set<Creceipt> getCreceipts() {
		return this.creceipts;
	}

	public void setCreceipts(Set<Creceipt> creceipts) {
		this.creceipts = creceipts;
	}

}
